package com.villaday.idf.adapter;

import android.content.Context;
import android.view.View;

import com.villaday.idf.R;
import com.villaday.idf.base.AbsRecyclerViewAdapter;
import com.villaday.idf.base.OnAdapterCallbackListener;
import com.villaday.idf.custom.foldtext.FoldTextView;
import com.villaday.idf.custom.foldtext.SpannableFoldTextView;

/**
 * 首页动态列表
 */

public class UpgradeVipGitPacgageAdapter extends AbsRecyclerViewAdapter<Integer> {
    private OnAdapterCallbackListener onAdapterCallbackListener;
    private View.OnClickListener onClickListener;

    public UpgradeVipGitPacgageAdapter(Context context, OnAdapterCallbackListener onAdapterCallbackListener) {
        super(context, R.layout.recyclerview_upgrade_vip_git_package, R.layout.item_page_loading,
                R.layout.item_page_bottom);
        this.onAdapterCallbackListener = onAdapterCallbackListener;
    }

    @Override
    public int getItemType(Integer d) {
        return d;
    }

    @Override
    public void onBindHolder(AbsRecyclerViewAdapter.RecyclerViewHolder holder, Integer d, int position) {
        switch (d) {
            case 0: {
                holder.setOnClickListener(R.id.ll_inner_item_layout)
                        .setOnClickListener(R.id.tv_upgrade_btn);
            }
            break;
            case 1://滑到底，加载下一页
                onAdapterCallbackListener.onCallback();
                break;
        }
    }
}
